package com.witmed.lib_common.utils

import android.app.Dialog
import android.content.Context
import android.graphics.Point
import android.os.Bundle
import android.widget.Button
import android.widget.ProgressBar
import android.widget.TextView
import com.witmed.lib_common.R

class DownloadDialog(context: Context):Dialog(context) {
    lateinit var title:TextView
    lateinit var content:TextView
    lateinit var dialog:ProgressBar
    lateinit var btn_cancel:Button
    lateinit var btn_yes:Button

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.layout_dialog)
        val manager = window?.windowManager
        val attributes = window?.attributes
        val point = Point()
        val width = manager?.defaultDisplay?.width
        if (width != null) {
            window?.attributes?.width=(width*0.6).toInt()
        }
        title=findViewById(R.id.tv_title)
        content=findViewById(R.id.tv_content)
        dialog=findViewById(R.id.bar)
        btn_cancel=findViewById(R.id.btn_cancel)
        btn_yes=findViewById(R.id.btn_yes)
    }
}